package cn.pink.core.support.serializer;

/**
 * @Author: pink
 * @Date: 2022/8/30 20:22
 */
public class SerializerUtil {
    private static final FSTSerializer serializer = new FSTSerializer();

    public static byte[] serialize(Object obj) {
        if (obj == null) {
            return null;
        }

        return serializer.serialize(obj);
    }

    public static Object deserialize(byte[] bytes) {
        if (bytes == null || bytes.length == 0) {
            return null;
        }

        return serializer.deserialize(bytes);
    }
}
